<template>
  <div class="index">
    <!-- 头部搜索 -->
    <div class="header">
      <div class="ret iconfont icon-lvyou"></div>
      <router-link to="/search" class="shell">
        <div class="search iconfont icon-sousuo"></div>
        <input class="setSearch" type="text" placeholder="输入广州景点名称" />
      </router-link>
      <div @click="tomap()" class="city">
        广州<span class="iconfont icon-wxbdingwei"></span>
      </div>
    </div>
    <!-- 主题功能 -->
    <div class="themes">
      <router-link
        :to="item.themes"
        class="theItem"
        v-for="(item, index) in theme"
        :key="index"
      >
        <div>
          <img :src="item.icon" alt="??" />
        </div>
        <div>{{ item.iconText }}</div>
      </router-link>
    </div>
    <!-- 定位与榜单 -->
    <!-- <div class="rank">
        <div class="position">
            <span class="iconfont icon-wxbdingwei"></span>
            <span>定位成功</span>
        </div>
        <div class="topList">
            <span class="iconfont icon-diqiu"></span>
            <span>必游榜单</span>
        </div>
      </div> -->
    <div class="gray"></div>
    <!-- 热门榜单 -->
    <div class="hot">
      <div class="hotTop">
        <div class="hL">
          <span class="fire">
            <img src="../assets/hot.png" alt="" />
          </span>
          <span>本周热门榜单</span>
        </div>
        <router-link to="/classification" class="hR">
          <span>热门景点</span>
          <span class="iconfont icon-arrow-right"></span>
        </router-link>
      </div>
      <div class="hots">
        <div class="hotView">
          <div class="hotItem" v-for="(item, index) in views" :key="index">
            <router-link :to="item.rou">
              <div>
                <img :src="item.src" alt="" />
              </div>
              <div>{{ item.viewText }}</div>
            </router-link>
          </div>
        </div>
      </div>
    </div>
    <div class="gray"></div>
    <!-- 猜你喜欢 -->
    <div class="guess">
      <div>
        <span class="iconfont love icon-daohangshoucangyishoucang-copy"></span>
        <span>猜你喜欢</span>
      </div>
      <div v-for="(item, index) in like" :key="index">
        <router-link :to="item.jump" class="guessV">
          <div class="gueL">
            <img :src="item.src" alt="" />
          </div>
          <div class="gueR">
            <div>{{ item.viewName }}</div>
            <div>
              <div class="stars">
                <span class="iconfont icon-shoucang1"></span>
                <span class="iconfont icon-shoucang1"></span>
                <span class="iconfont icon-shoucang1"></span>
                <span class="iconfont icon-shoucang1"></span>
                <span class="iconfont icon-shoucang1"></span>
              </div>
              <span class="zn">{{ item.commen }}</span>
            </div>
            <div class="guePrice">
              <span class="rmb">￥</span>
              <span>{{ item.prize }}</span>
              <span class="zn">起</span>
              <span class="priR">{{ item.local }}</span>
            </div>
          </div>
        </router-link>
      </div>
    </div>
    <footer-btn></footer-btn>
    <div class="foot"></div>
  </div>
</template>

<style lang = "less">
.index {
  height: 100vh;
  overflow: auto;
  a {
    color: black;
    &:active {
      color: black;
    }
  }
  .gray {
    display: block;
    height: 10px;
    background: rgb(240, 242, 245);
  }
  .header {
    background-color: rgb(76, 192, 228);
    height: 44px;
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    color: white;
    .ret {
      font-size: 20px;
    }
    .city {
      font-size: 14px;
    }
    .shell {
      position: relative;
      .search {
        position: absolute;
        top: 5px;
        left: 6px;
        color: gray;
      }
      .setSearch {
        width: 240px;
        padding: 3px 0;
        padding-left: 28px;
        height: 20px;
        line-height: 20px;
        outline: none;
        border: 1px solid white;
        border-radius: 3px;
        color: #666;
        font-size: 14px;
      }
    }
  }
  .themes {
    color: #666;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-evenly;
    font-size: 14px;
    margin: 10px;
    .theItem {
      width: 25%;
      padding-bottom: 3px;
      img {
        width: 50px;
        height: 50px;
      }
    }
  }
  .rank {
    display: flex;
    align-items: center;
    margin-top: 10px;
    .position {
      padding: 10px 0;
      border-top: 1px solid #e0e0e0;
      border-bottom: 1px solid #e0e0e0;
      width: 50%;
    }
    .topList {
      border: 1px solid #e0e0e0;
      border-right: none;
      padding: 10px 0;
      width: 50%;
    }
  }
  .hot {
    .hotTop {
      margin: 0 10px;
      height: 50px;
      line-height: 50px;
      .hL {
        font-size: 16px;
        float: left;
        ::after {
          content: "";
          clear: both;
        }
        .fire {
          margin-right: 5px;
        }
        img {
          widows: 16px;
          height: 16px;
        }
      }
      .hR {
        font-size: 12px;
        float: right;
        color: gray;
        ::after {
          content: "";
          clear: both;
        }
      }
    }
    .hots {
      width: 100%;
      overflow-x: scroll;
      white-space: nowrap;
    }
    .hotView {
      margin-bottom: 10px;
      display: flex;
      align-items: center;
      font-size: 12px;
      color: gray;

      .hotItem {
        padding-left: 10px;
        &:last-child {
          padding-right: 20px;
        }
      }
      img {
        width: 100px;
        height: 100px;
      }
    }
  }
  .guess {
    text-align: left;
    margin: 10px;
    .love {
      color: red;
      margin-right: 5px;
    }
    .guessV {
      margin: 10px 0;
      display: flex;
      color: black;
      .gueL {
        width: 34%;
        img {
          width: 100%;
          height: 100%;
        }
      }
      .gueR {
        margin: 10px;
        margin-bottom: 0;
        width: 66%;
        display: flex;
        flex-direction: column;
        justify-content: space-evenly;
        div {
          margin-bottom: 5px;
        }
        .stars {
          color: orange;
          padding-right: 10px;
          display: inline-block;
        }
        .guePrice {
          color: orange;
          font-size: 22px;
          .rmb {
            font-size: 12px;
          }
          .priR {
            color: gray;
            font-size: 14px;
            float: right;
          }
        }
        .zn {
          color: grey;
          font-size: 12px;
        }
      }
    }
  }

  .foot {
    height: 60px;
  }
}
</style>

<script>
import footerBtn from "../components/footerBtn.vue";
export default {
  data() {
    return {
      name: "index",
      theme: [
        {
          icon: "./imgs/theme1.png",
          iconText: "度假胜地",
          themes: "/holiday",
        },
        {
          icon: "./imgs/theme2.png",
          iconText: "主题乐园",
          themes: "/parks",
        },
        {
          icon: "./imgs/theme3.png",
          iconText: "水上夜景",
          themes: "/water",
        },
        {
          icon: "./imgs/theme4.png",
          iconText: "展览馆",
          themes: "/museum",
        },
        {
          icon: "./imgs/theme5.png",
          iconText: "自然风光",
          themes: "/nature",
        },
        {
          icon: "./imgs/theme6.png",
          iconText: "名胜古迹",
          themes: "/famous",
        },
        {
          icon: "./imgs/theme8.png",
          iconText: "动物园",
          themes: "/zoo",
        },
        {
          icon: "./imgs/theme7.png",
          iconText: "特色建筑",
          themes: "/Architecture",
        },
      ],
      views: [
        {
          src: "./imgs/view1.jpg",
          viewText: "长隆野生动物世界",
          rou: "detail",
        },

        {
          src: "./imgs/view7.jpg",
          viewText: "珠江夜游",
          rou: "river",
        },
        {
          src: "./imgs/view9.jpg",
          viewText: "长隆国际大马戏",
          rou: "happy",
        },

        {
          src: "./imgs/view2.jpg",
          viewText: "广州长隆欢乐世界",
          rou: "happy",
        },
        //  {
        //     src: "./imgs/view6.jpg",
        //     viewText: "岭南印象园"
        // },
        {
          src: "./imgs/view3.jpg",
          viewText: "广州塔",
          rou: "town",
        },
        {
          src: "./imgs/view4.jpg",
          viewText: "增城白水寨风景",
          rou: "white",
        },
        {
          src: "./imgs/view5.jpg",
          viewText: "广州动物园",
          rou: "zoo",
        },
        {
          src: "./imgs/view8.jpg",
          viewText: "广州融创雪世界",
          rou: "snow",
        },
      ],
      views2: [
        {
          src: "./imgs/view4.jpg",
          viewText: "长隆野生动物世界",
        },
        {
          src: "./imgs/view5.jpg",
          viewText: "长隆野生动物世界",
        },
        {
          src: "./imgs/view6.jpg",
          viewText: "长隆野生动物世界",
        },
      ],
      like: [
        {
          src: "/./imgs/view1.jpg",
          viewName: "长隆野生动物世界",
          commen: "193291条评论",
          prize: "262",
          local: "番禺区",
          jump: "/detail",
        },
        {
          src: "./imgs/view3.jpg",
          viewName: "广州塔",
          commen: "37792条评论",
          prize: "147",
          local: "海珠区",
          jump: "/town",
        },
        {
          src: "./imgs/view2.jpg",
          viewName: "广州长隆欢乐世界",
          commen: "97285条评论",
          prize: "190",
          local: "番禺区",
          jump: "/happy",
        },
      ],
    };
  },
  methods: {
    tomap() {
      this.$router.push({
        name: `map`,
      });
    },
  },
  components: {
    footerBtn,
  },
};
</script>

